/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.rbh.risk.service.impl;

import com.rbh.risk.dao.SubCauseDao;
import com.rbh.risk.entity.MainCause;
import com.rbh.risk.entity.SubCause;
import com.rbh.risk.service.SubCauseService;
import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

@Service("subCauseService")
public class SubCauseServiceImpl implements SubCauseService {

    @Autowired
    private SubCauseDao subCauseDao;
    
    @Transactional(readOnly = false)
    @Override
    public void insert(SubCause subCause) {
        this.subCauseDao.insert(subCause);
    }

    @Transactional(readOnly = false)
    @Override
    public void update(SubCause subCause) {
        this.subCauseDao.update(subCause);
    }

    @Transactional(readOnly = false)
    @Override
    public void delete(SubCause subCause) {
        this.subCauseDao.delete(subCause);
    }

    @Transactional(readOnly = true)
    @Override
    public SubCause getById(Integer subCauseId) {
        return this.subCauseDao.getById(subCauseId);
    }

    @Transactional(readOnly = true)
    @Override
    public List<SubCause> getAll() {
        return this.subCauseDao.getAll();
    }

    @Transactional(readOnly = true)
    @Override
    public List<SubCause> getByMainCause(MainCause mainCause) {
        return this.subCauseDao.getByMainCause(mainCause);
    }
    
}
